<template>
  <view class="search-list" :style="{'background-color':bgcolor}">
    <view class="search-list-box" :style="{'border-radius':radius+'px'}" @click="gotoSearch">
      <uni-icons custom-prefix="custom-icon" type="search" size="18"></uni-icons>
      <view class="search-text">搜索</view>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    data() {
      return {
        
      };
    },
    props:{
      //背景颜色
      bgcolor:{
        type:String,
        default:"#C00000"
      },
      //搜索框圆角尺寸
      radius:{
        type:Number,
        default:15
      }
    },methods:{
      gotoSearch(){
        //console.log("ok22222")
        //使用emit方法来实现触发外界的事件绑定的事件处理函数
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
.search-list{
  height: 50px;
  display: flex;
  // background-color: #c00000;
  padding:0 10px;
  align-items: center;
  .search-list-box{
    display: flex;
    height: 36px;
    background-color: #ffffff;
    width: 100%;
    align-items: center;
    justify-content: center;
    // border-radius: 15px;
    .search-text{
      font-size: 14px;
      margin-left: 5px;
    }
  }
}
</style>